<?php
namespace app\user\controller;

use app\common\controller\Front;

class Login extends Front
{
    //密码登录界面
    public function index()
    {
        $this->site['title']       = '密码登录';

        $this->site['keywords']    = '请使用手机号与密码登录';

        $this->site['description'] = 'AIDAICUOAIDAICUOAIDAICUOAIDAICUOAIDAICUOAIDAICUO';

        $this->assign($this->site);
        
        return $this->fetch();
    }
    
    //密码登录验证
    public function update()
    {
        $post = [];
        $post['user_mobile']  = input('post.user_mobile/s');
        $post['user_pass']    = input('post.user_pass/s');
        $post['user_captcha'] = input('post.user_captcha/s');
        //调用登录接口
        if(!model('common/User','loglic')->loginMobile($post)){
            $this->error(model('common/User','loglic')->getError());
        }
        //登录成功
        $this->success('ok',dcUrlRedirect());
    }
}